package health_system.health_system.dto;

import health_system.health_system.entity.PrivacySettings;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class PrivacySettingsDTO {
    private Long id;
    private boolean moments = true;
    private boolean location = true;
    private boolean profileInfo = true;
    private boolean lastSeen = true;
    private boolean phone = false;
    private boolean email = false;
    
    public static PrivacySettingsDTO fromEntity(PrivacySettings privacySettings) {
        if (privacySettings == null) {
            return null;
        }
        
        return PrivacySettingsDTO.builder()
                .id(privacySettings.getId())
                .moments(privacySettings.isMoments())
                .location(privacySettings.isLocation())
                .profileInfo(privacySettings.isProfileInfo())
                .lastSeen(privacySettings.isLastSeen())
                .phone(privacySettings.isPhone())
                .email(privacySettings.isEmail())
                .build();
    }
} 